import router from "@/router";
router.beforeEach((to, from, next) => {
    const token = localStorage.getItem('token')
    if (to.path === '/login') {
        next()
    } else {
        if (token) {
            next()
        } else {
            next('/login')
        }
    }
})